using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;

namespace Prota.Editor
{
    public struct EditorInfoCache<T>
    {
        public int updatedFrameTime;
        
        public T data;
        
        public Action<T> OnEditorUpdate;
        
        void Update()
        {
            OnEditorUpdate?.Invoke(data);
        }
        
        public void Step()
        {
            if(!updatedFrameTime.CompareAndReplace(Time.frameCount))
            {
                Update();
            }
        }
        
    }
}
